package com.sdtele.tta.operation;



import com.sdtele.tta.dac.Dac;
import com.sdtele.tta.models.JsonRequest;
import com.sdtele.tta.models.JsonResponse;
import com.sdtele.tta.models.Team;


public class OperationGetTeam extends Operation{
	
	
	public JsonResponse handle(JsonRequest jsonRequest) {
		System.out.println("OperationLogin:req="+jsonRequest);
		JsonResponse jres = new JsonResponse();
		
		long teamId =jsonRequest.getJsonObject().get("teamId").getAsLong();
		Team team = Dac.getInstance().getTeam(teamId);
		System.out.println(team);
        if(team.getId()>0)
        {
        	jres.setStatus(0);
        	jres.setMessage("返回组织信息");
        	jres.setEntity(team);
		}else{
			
			jres.setStatus(1);
			jres.setMessage("无相应组织");
			
		}
			
		return jres;
	}		
		
}

